<?php

namespace WoXuanWang\Comment\Models;

use Eloquent as Model;

/**
 * Class Comment
 * @package WoXuanWang\Comment\Models
 * @version April 6, 2017, 6:32 pm CST
 */
class Comment extends Model
{

    public $table = 'comments';
    


    public $fillable = [
        'video_id',
        'user_id',
        'content',
    ];

    /**
     * The attributes that should be casted to native types.
     *
     * @var array
     */
    protected $casts = [
        'video_id' => 'integer',
        'user_id' => 'integer',
        'content' => 'string',
    ];

    /**
     * Validation rules
     *
     * @var array
     */
    public static $rules = [
        
    ];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     **/
    public function video()
    {
        return $this->belongsTo(\WoXuanWang\Comment\Models\Video::class, 'video_id', 'id');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     **/
    public function user()
    {
        return $this->belongsTo(\WoXuanWang\Comment\Models\User::class, 'user_id', 'id');
    }
}
